<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>

<body>
<?php

require_once '../../inc.php';

$fn=new Clfn(__FILE__);
$fn->requireOnce(array(
"../../"."inc/clflv.cls.php",
"../../"."inc/clscandir.cls.php",
"../../"."inc/cltranscoding.cls.php"
));
$fn->requireDirOnce();
$fn->requireDirOnce("../cinc");
$fn->requireOnce("../cinc");
//$s=new clscandir('I:\AppServ\www\VPLIST');
// 
//$arrx=$s->get_complete_files();
// secho($arrx);  


$s=new clscandir(dirname(__FILE__)."/../../inc/");

$arrx=$s->get_complete_files();


class Cltranscoding_ex{
    public function __construct(){}
	public function __destruct(){}	
	public static function iconv($source,$des='',$string){
 
	     $encode = mb_detect_encoding($string, 
		 array('ASCII','UTF-8','GB2312','GBK','BIG5')); 
		 
		 if ($encode == "EUC-CN"){
			if(in_array(
			$source,array('GB2312','GBK'),false))
			{
				if(!$des){
					$des="UTF-8";
				}
					
		    $string = iconv($source,$des,$string);
			return $string;
		    }
		 }else{
		 
		 $string = iconv($source,$des,$string);
		 }
		 return $string;
		
	}
	
}
//foreach($arrx as $string){
//	
//	
//			 $encode = mb_detect_encoding($string, array('ASCII','UTF-8','GB2312','GBK','BIG5')); 
//			//$encode = mb_detect_encoding($string);
//		echo $encode;
//		 
//		//if ($encode == "UTF-8"){
////		$string = iconv("UTF-8","GBK",$string);
////		}
//
//       if ($encode == "EUC-CN"){
//		$string = iconv("GB2312","UTF-8",$string);
//		}
//		echo _mkcstr($string)->High("green")->Val().'<br>';
//}
 
 
foreach($arrx as $string){
	
	 
		$string = Cltranscoding::iconv("GB2312","UTF-8",$string);
		 
		echo _mkcstr($string)->High("green")->Val().'<br>';
}
 

$arrx=  Clscandir::toHttpUrl($arrx,"/VPLIST/")  ;

 
 ?>
</body>
</html>